#ifndef _DEMURA_H_
#define _DEMURA_H_

//#include "stm32fxxx.h"
#include "SSD2832.h"
//#include <stdio.h> 
//#include <stdlib.h> 
#include <ctype.h>                      /* Character functions                */
//-----------------------------------------------------------------------------------------
extern u32 VCP_Receive_True_num;   //单次Mura数据接收累计
extern u32 USB_Rx_Demura_Total_Num;//Mura数据接收全累计
extern u32 USB_Tx_Demura_Num;
extern u32 USB_Rx_Demura_Total_Num_Temp;
extern u32 USB_Rx_Demura_Num;
extern u32 USB_Rx_Demura;

extern u8  USB_Rx_Demura_End_Flag; //Demura数据全部完成标志
extern u8  DemuraIctype;  		  	 //识别IC型号
extern u8  Demura_OLEDModule_flag; //同型DDIC下的衍生项目
extern u32 Demura_START_FLAG;  		 //Demura 数据传输开始标志

extern u32 DemuraRecivedNum;       //统计已经接收的数据数量
extern u32 DemuraTransOnce;        //单笔Demura资料传输数据量
extern u8  Demura_first_package_flag;  //首次发送标志 2C/3C use

extern u16  DemuraSize_H8; //Hefei Gen demura define for record Demura size 
extern u8  DemuraSize_L8; //Hefei Gen demura define for record Demura size 
extern u8  DemuraAddr_1st;//Hefei Gen demura define for record Demura 1st addr 
extern u8  DemuraAddr_2nd;//Hefei Gen demura define for record Demura 2nd addr  

void Write_Data_to_Demura_RAM(USBD_HandleTypeDef *pdev,uint8_t  ep_addr,u8 SigMode ,u8 channel,u8 buffer[],u16 LP_B7_Data,u16 HS_B7_Data);
extern void SSD2828_W_RAM_demura_buffer_part_rgb(float pclk,u8 SigMode ,u8* buffer ,u16 length,u8  multiple ,u8 DisMode);
extern void SSD2828_W_RAM_demura_buffer_part_bgr(float pclk,u8 SigMode ,u8* buffer ,u16 length,u8  multiple ,u8 DisMode);
extern void SSD2828_W_RAM_demura_buffer_part_bgr_plus(float pclk,u8 SigMode ,u8* buffer ,u16 length,u8  multiple ,u8 DisMode);
//Demura
//--Demura用--
void DemuraData2DDICRam(USBD_HandleTypeDef *pdev,uint8_t  ep_addr,u8 SigMode ,u8 channel,u8 buffer[],u16 LP_B7_Data,u16 HS_B7_Data);
void Demura_shenxian(USBD_HandleTypeDef *pdev,uint8_t  ep_addr,u8 SigMode ,u8 channel,u8 buffer[],u16 LP_B7_Data,u16 HS_B7_Data);
void Demura2RAM(USBD_HandleTypeDef *pdev,uint8_t  ep_addr,u8 SigMode ,u8 channel,u8 buffer[],u16 LP_B7_Data,u16 HS_B7_Data);
void SSD2828_W_RAM_buffer_8bits_part_NT37701(float pclk,u8 SigMode ,u8* buffer ,u16 length,u8  multiple ,u8 DisMode);
void Demura2RAM_HFGen(USBD_HandleTypeDef *pdev,uint8_t  ep_addr,u8 SigMode ,u8 channel,u8 buffer[],u16 LP_B7_Data,u16 HS_B7_Data);
void SSD2828_W_RAM_buffer_8bits_part_NT37801(float pclk,u8 SigMode ,u8* buffer ,u16 length,u8  multiple ,u8 DisMode);

#endif
